package net.itgoo.parkingpay.rest.model;

import org.json.JSONObject;

public class ParkingCardModel {
    public long id;
    public String cardNo;
    public String plate;
    public int state;
    public int cid;
    public int isAuto;

    public static ParkingCardModel parse(JSONObject jsonObject) {
        ParkingCardModel parkModel = new ParkingCardModel();
        if (jsonObject != null) {
            try {
                parkModel.id = jsonObject.getLong("id");
                parkModel.plate = jsonObject.getString("plateno");
                parkModel.cardNo = jsonObject.getString("cardno");
                parkModel.state = jsonObject.getInt("state");
                parkModel.cid = jsonObject.getInt("cid");
                parkModel.isAuto = jsonObject.getInt("isauto");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return parkModel;
    }
}
